package com.wimcorp.magic.cost;

import javax.persistence.Entity;

import com.wimcorp.magic.exception.CostException;

@Entity
public class PayLife extends Cost {

	int amount = 0;

	protected PayLife() {
	}

	public PayLife(int amount){
		this.amount = amount;
	}
	
	public PayLife(PayLife cost) {
		super(cost);
		this.amount = cost.getAmount();
	}

	@Override
	public void payCost() throws CostException{
		
		getPlayer().subtractLife(amount);
	}

	@Override
	public Cost clone() {
		return new PayLife(this);
	}

	public int getAmount() {
		return amount;
	}
	
	public String toString() {
		return String.format("Pay %s life.",amount);

	}

}
